package com.hnevc.caoliuye;

public class Homework {
        public static void main(String[] args) {
            double i = 1;//分子
            double a = 2;//分母
            double temp = 0;
            double sum = 0;
            for (int b = 0; b<20;b++){
                sum+=a/i;
                temp=i;
                i=a;//分母为上一个分子
                i=a+temp;
            }
            System.out.println(sum);
        }
}
